import { Form, Input, Button, Card, Space, InputNumber } from 'antd'

const Settings = () => {
    const [form] = Form.useForm()

    const onFinish = (values) => {
        console.log('Success:', values)
    }

    return (
        <Space direction="vertical" size="large" style={{ width: '100%' }}>
            <Card title="基础设置">
                <Form
                    form={form}
                    layout="vertical"
                    onFinish={onFinish}
                    initialValues={{
                        shopName: '美发店名称',
                        phone: '010-12345678',
                        address: '北京市朝阳区xxx街xxx号',
                    }}
                >
                    <Form.Item
                        name="shopName"
                        label="店铺名称"
                        rules={[{ required: true, message: '请输入店铺名称' }]}
                    >
                        <Input />
                    </Form.Item>
                    <Form.Item
                        name="phone"
                        label="联系电话"
                        rules={[{ required: true, message: '请输入联系电话' }]}
                    >
                        <Input />
                    </Form.Item>
                    <Form.Item
                        name="address"
                        label="店铺地址"
                        rules={[{ required: true, message: '请输入店铺地址' }]}
                    >
                        <Input />
                    </Form.Item>
                    <Form.Item>
                        <Button type="primary" htmlType="submit">
                            保存设置
                        </Button>
                    </Form.Item>
                </Form>
            </Card>

            <Card title="会员积分规则">
                <Form
                    layout="vertical"
                    initialValues={{
                        pointsPerYuan: 1,
                        minimumPoints: 100,
                    }}
                >
                    <Form.Item
                        name="pointsPerYuan"
                        label="消费1元获得积分数"
                    >
                        <InputNumber min={0} />
                    </Form.Item>
                    <Form.Item
                        name="minimumPoints"
                        label="最低兑换积分"
                    >
                        <InputNumber min={0} />
                    </Form.Item>
                    <Form.Item>
                        <Button type="primary">保存规则</Button>
                    </Form.Item>
                </Form>
            </Card>
        </Space>
    )
}

export default Settings 